<template>
  <Dialog :title="dialogTitle" v-model="dialogVisible" width="1100" class="detail-dialog">
    <div class="detail-container">
      <!-- 详情头部 -->
      <div class="detail-header">
        <div class="header-icon">
          <Icon icon="ep:phone" />
        </div>
        <div class="header-content">
          <h3 class="detail-title">通话详情</h3>
          <p class="detail-subtitle">查看完整的通话记录和分析结果</p>
        </div>
      </div>

      <!-- 基本信息 -->
      <div class="info-section">
        <div class="section-header">
          <Icon icon="ep:info-filled" class="section-icon" />
          <span class="section-title">基本信息</span>
        </div>
        <el-descriptions border :column="2" v-loading="loadingValue" class="enhanced-descriptions">
          <el-descriptions-item label="被叫号码">
            <div class="info-item">
              <Icon icon="ep:phone" class="item-icon" />
              <span class="item-value">{{ detailData.encryptCallee }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="员工">
            <div class="info-item">
              <Icon icon="ep:user" class="item-icon" />
              <span class="item-value">{{ detailData.ownerUserName }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="名称">
            <div class="info-item">
              <Icon icon="ep:document" class="item-icon" />
              <span class="item-value">{{ detailData.sourceName }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="号码来源">
            <div class="info-item">
              <Icon icon="ep:location" class="item-icon" />
              <span class="item-value">{{ SourceNameMap[detailData.source] }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="通话状态">
            <div class="status-item">
              <el-tag v-if="detailData.resultCode == 'success'" type="success" class="status-tag">
                <Icon icon="ep:check" class="tag-icon" />
                成功
              </el-tag>
              <el-tag v-else-if="detailData.resultCode == 'leak'" type="warning" class="status-tag">
                <Icon icon="ep:warning" class="tag-icon" />
                漏接
              </el-tag>
              <el-tag v-else-if="detailData.resultCode == 'fail'" type="danger" class="status-tag">
                <Icon icon="ep:close" class="tag-icon" />
                失败
              </el-tag>
              <el-tag v-else-if="detailData.resultCode == 'illegal'" type="info" class="status-tag">
                <Icon icon="ep:info-filled" class="tag-icon" />
                错误
              </el-tag>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="挂断原因">
            <div class="info-item">
              <Icon icon="ep:warning-filled" class="item-icon" />
              <span class="item-value">{{ detailData.resultMsg }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="呼叫时间">
            <div class="time-item">
              <Icon icon="ep:clock" class="item-icon" />
              <span class="item-value">{{ formatDate(detailData.createTime) }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="应答时间">
            <div class="time-item">
              <Icon icon="ep:clock" class="item-icon" />
              <span class="item-value">{{ formatDate(detailData.startTime) }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="结束时间">
            <div class="time-item">
              <Icon icon="ep:clock" class="item-icon" />
              <span class="item-value">{{ formatDate(detailData.endTime) }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="通话时长(秒)">
            <div class="duration-item">
              <Icon icon="ep:timer" class="item-icon" />
              <span class="item-value">{{ detailData.callSecond }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="计费时长(分)">
            <div class="duration-item">
              <Icon icon="ep:money" class="item-icon" />
              <span class="item-value">{{ detailData.callMinute }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="意向等级">
            <div class="level-item">
              <Icon icon="ep:star" class="item-icon" />
              <span class="item-value">{{ detailData.levelName }}</span>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="备注" :span="2">
            <div class="remark-item">
              <Icon icon="ep:edit" class="item-icon" />
              <span class="item-value">{{ detailData.remark || '-' }}</span>
            </div>
          </el-descriptions-item>
        </el-descriptions>
      </div>

      <!-- 分析数据 -->
      <div class="analysis-section">
        <div class="section-header">
          <Icon icon="ep:data-analysis" class="section-icon" />
          <span class="section-title">分析数据</span>
        </div>
        <div class="analysis-grid">
          <div class="analysis-card">
            <div class="card-header">
              <Icon icon="ep:question-filled" class="card-icon" />
              <span class="card-title">问题命中</span>
            </div>
            <div class="card-content">
              <div class="metric-item">
                <span class="metric-label">所有问题：</span>
                <span class="metric-value">{{ detailData.mingzhongsuoyouwenti || 0 }}</span>
              </div>
              <div class="metric-item">
                <span class="metric-label">业务问题：</span>
                <span class="metric-value">{{ detailData.mingzhongyewuwenti || 0 }}</span>
              </div>
            </div>
          </div>

          <div class="analysis-card">
            <div class="card-header">
              <Icon icon="ep:chat-dot-round" class="card-icon" />
              <span class="card-title">互动统计</span>
            </div>
            <div class="card-content">
              <div class="metric-item">
                <span class="metric-label">肯定数：</span>
                <span class="metric-value positive">{{ detailData.kendingcishu || 0 }}</span>
              </div>
              <div class="metric-item">
                <span class="metric-label">拒绝数：</span>
                <span class="metric-value negative">{{ detailData.jujuecishu || 0 }}</span>
              </div>
              <div class="metric-item">
                <span class="metric-label">讲话次数：</span>
                <span class="metric-value">{{ detailData.kehujianghuacishu || 0 }}</span>
              </div>
            </div>
          </div>

          <div class="analysis-card">
            <div class="card-header">
              <Icon icon="ep:finished" class="card-icon" />
              <span class="card-title">流程状态</span>
            </div>
            <div class="card-content">
              <div class="metric-item">
                <span class="metric-label">完整流程：</span>
                <span class="metric-value">{{ detailData.zouwanzhuliucheng || '-' }}</span>
              </div>
              <div class="metric-item">
                <span class="metric-label">最后一句话：</span>
                <span class="metric-value">{{
                  resultSeep[detailData.kehuzuihouyijuhua] || '-'
                }}</span>
              </div>
            </div>
          </div>
        </div>

        <!-- 客户通话内容 -->
        <div class="content-section">
          <div class="content-header">
            <Icon icon="ep:chat-line-round" class="content-icon" />
            <span class="content-title">客户通话内容</span>
          </div>
          <div class="content-body">
            <div class="content-item">
              <span class="content-label">原始内容：</span>
              <div class="content-text">{{ detailData.kehutonghuaneirong || '-' }}</div>
            </div>
            <div class="content-item">
              <span class="content-label">关键词分词：</span>
              <div class="keywords">
                <el-tag
                  v-for="(keyword, index) in (detailData.kehutonghuaneirongKeys || '')
                    .split(' ')
                    .filter((k) => k)"
                  :key="index"
                  class="keyword-tag"
                  size="small"
                >
                  {{ keyword }}
                </el-tag>
                <span v-if="!detailData.kehutonghuaneirongKeys" class="no-keywords"
                  >暂无关键词</span
                >
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 录音和对话 -->
      <div class="media-section">
        <div class="section-header">
          <Icon icon="ep:video-play" class="section-icon" />
          <span class="section-title">录音与对话</span>
        </div>

        <!-- 音频播放器 -->
        <div class="audio-section" v-if="detailData.recordUrl">
          <div class="audio-header">
            <Icon icon="ep:microphone" class="audio-icon" />
            <span class="audio-title">录音播放</span>
          </div>
          <div class="audio-player">
            <AudioPlayers
              :url="detailData.recordUrl"
              ref="audioPlays"
              @scrollToWhere="scrollToWhere"
            />
          </div>
        </div>

        <!-- 对话内容和AI分析 -->
        <div class="dialog-section">
          <el-row :gutter="20" class="dialog-row">
            <!-- 对话记录 -->
            <el-col :xs="24" :sm="24" :md="12" class="dialog-col">
              <div class="dialog-container">
                <div class="dialog-header">
                  <Icon icon="ep:chat-dot-square" class="dialog-icon" />
                  <span class="dialog-title">对话记录</span>
                </div>
                <el-scrollbar
                  height="300px"
                  class="dialog-scrollbar"
                  v-if="detailData.recordUrl && detailData.content && detailData.content.length"
                  ref="scrollbar"
                >
                  <div class="dialog-content">
                    <div
                      class="message-item"
                      :class="item.type == 2 ? 'message-left' : 'message-right'"
                      v-for="item in detailData.content"
                      :key="item.id"
                    >
                      <div class="message-header">
                        <div
                          class="message-avatar"
                          :class="item.type == 2 ? 'avatar-system' : 'avatar-user'"
                        >
                          <Icon :icon="item.type == 2 ? 'ep:service' : 'ep:user'" />
                        </div>
                        <span
                          class="message-time"
                          @click="startTimePlay(item.createTime, detailData.content[0].createTime)"
                        >
                          {{ formatDate(item.createTime) }}
                        </span>
                      </div>
                      <div
                        class="message-bubble"
                        :class="item.type == 2 ? 'bubble-system' : 'bubble-user'"
                      >
                        {{ item.result }}
                      </div>
                    </div>
                  </div>
                </el-scrollbar>
                <div v-else class="no-dialog">
                  <Icon icon="ep:chat-dot-square" class="no-dialog-icon" />
                  <span class="no-dialog-text">暂无对话记录</span>
                </div>
              </div>
            </el-col>

            <!-- AI分析 -->
            <el-col :xs="24" :sm="24" :md="12" class="ai-col">
              <div class="ai-container">
                <div class="ai-header">
                  <Icon icon="ep:cpu" class="ai-icon" />
                  <span class="ai-title">AI分析结果</span>
                </div>
                <div class="ai-content">
                  <AbsAi v-if="detailData.summary" :content="detailData.summary" />
                  <div v-else class="no-ai">
                    <Icon icon="ep:cpu" class="no-ai-icon" />
                    <span class="no-ai-text">暂无AI分析结果</span>
                  </div>
                </div>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
  </Dialog>
</template>

<script setup lang="ts">
import { formatDate } from '@/utils/formatTime'
import { RecordApi } from '@/api/call/record'
import AbsAi from './absAi.vue'
/** 外呼详情 */
defineOptions({ name: 'DetailDes' })

const resultTypeMap = {
  1: '呼叫成功',
  10: '播放语音时挂断',
  11: '播放语音完挂断',
  90: '系统线路异常',
  91: '未接通',
  92: '被叫空号或号码错误',
  93: '客户拒接或挂断',
  94: '客户忙线未接听',
  95: '坐席忙线未接听',
  99: '呼叫失败'
}
const resultSeep = {
  1: '肯定',
  2: '否定',
  3: '拒绝',
  4: '未识别'
}
const dialogTitle = ref('详情') // 弹窗的标题
const dialogVisible = ref(false) // 弹窗的是否展示
const detailData = ref({})
const audioPlays = ref(null)

/*定位到进度条*/
const startTimePlay = (nowTime, statrTime) => {
  audioPlays.value.seekTotime(convertToSeconds(nowTime, statrTime))
}
/*计算秒*/
const convertToSeconds = (nowTime, statrTime) => {
  return (nowTime - statrTime) / 1000
}
const scrollbar = ref(null)
/*定位到滚动处*/
const scrollToWhere = (percentage) => {
  scrollbar.value?.setScrollTop(58 * detailData.value.content.length * (percentage / 100))
}
// 时间换算
const transTime = (duration) => {
  const minutes = Math.floor(duration / 60)
  const seconds = Math.floor(duration % 60)
  const milliseconds = Math.floor((duration % 1) * 1000) // 计算毫秒部分
  const formattedMinutes = String(minutes).padStart(2, '0') //使用0填充使字符串长度达到2
  const formattedSeconds = String(seconds).padStart(2, '0')
  const formattedMilliseconds = String(milliseconds).padStart(3, '0')
  return `${formattedMinutes}:${formattedSeconds}:${formattedMilliseconds}`
}
const SourceNameMap = {
  customer: '客户',
  clue: '线索',
  contact: '联系人',
  ent: '企业大数据',
  none: '手拨'
}
const loadingValue = ref(false)
/** 打开弹窗 */
const open = async (id: number, reqNo) => {
  dialogVisible.value = true
  if (id) {
    loadingValue.value = true
    try {
      detailData.value.recordUrl = null
      detailData.value = await RecordApi.getRecord(id)
      detailData.value.content = await RecordApi.acsNlpResult({
        callId: reqNo
      })
    } finally {
      loadingValue.value = false
    }
  }
}
defineExpose({ open }) // 提供 open 方法，用于打开弹窗
</script>

<style lang="scss" scoped>
.detail-dialog {
  :deep(.el-dialog) {
    border-radius: 16px;
    overflow: hidden;

    @media (max-width: 768px) {
      width: 95% !important;
      margin: 20px auto;
    }
  }

  :deep(.el-dialog__header) {
    background: linear-gradient(135deg, #0052cc 0%, #1d4ed8 100%);
    color: white;
    padding: 20px 24px;
  }

  :deep(.el-dialog__title) {
    color: white;
    font-weight: 600;
    font-size: 18px;
  }

  :deep(.el-dialog__headerbtn .el-dialog__close) {
    color: white;
    font-size: 18px;
  }

  :deep(.el-dialog__body) {
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
  }
}

.detail-container {
  background: #f8fafc;
}

/* 详情头部 */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: white;
  border-bottom: 1px solid rgba(0, 82, 204, 0.1);

  @media (max-width: 768px) {
    padding: 16px;
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

.header-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0052cc 0%, #1d4ed8 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;

  @media (max-width: 768px) {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

.header-content {
  flex: 1;
}

.detail-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;

  @media (max-width: 768px) {
    font-size: 18px;
  }
}

.detail-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;

  @media (max-width: 768px) {
    font-size: 12px;
  }
}

/* 区块样式 */
.info-section,
.analysis-section,
.media-section {
  background: white;
  margin: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 82, 204, 0.1);

  @media (max-width: 768px) {
    margin: 12px 16px;
  }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(0, 82, 204, 0.1);

  @media (max-width: 768px) {
    padding: 16px 20px 12px;
  }
}

.section-icon {
  color: #0052cc;
  font-size: 18px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

/* 描述列表样式 */
.enhanced-descriptions {
  margin: 20px;

  @media (max-width: 768px) {
    margin: 0 20px 20px;

    :deep(.el-descriptions__body) {
      .el-descriptions__table {
        .el-descriptions__cell {
          padding: 12px 8px;
        }
      }
    }
  }

  :deep(.el-descriptions__header) {
    .el-descriptions__title {
      font-weight: 600;
      color: #374151;
    }
  }

  :deep(.el-descriptions__body) {
    .el-descriptions__table {
      .el-descriptions__cell {
        padding: 16px 12px;
        border-color: #f1f5f9;

        &.is-bordered-label {
          background: #f8fafc;
          font-weight: 500;
          color: #374151;
        }
      }
    }
  }
}

.info-item,
.time-item,
.duration-item,
.level-item,
.remark-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-icon {
  color: #6b7280;
  font-size: 14px;
  flex-shrink: 0;
}

.item-value {
  color: #1f2937;
  font-weight: 500;
}

.status-item {
  display: flex;
  align-items: center;
}

.status-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;

  .tag-icon {
    font-size: 12px;
  }
}

/* 分析数据样式 */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;

  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    padding: 0 20px 16px;
  }
}

.analysis-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 82, 204, 0.1);
    border-color: rgba(0, 82, 204, 0.2);
  }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card-icon {
  color: #0052cc;
  font-size: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.metric-label {
  color: #6b7280;
  font-weight: 500;
}

.metric-value {
  color: #1f2937;
  font-weight: 600;

  &.positive {
    color: #10b981;
  }

  &.negative {
    color: #ef4444;
  }
}

/* 内容区域样式 */
.content-section {
  margin-top: 16px;
  padding: 0 24px 20px;

  @media (max-width: 768px) {
    padding: 0 20px 16px;
  }
}

.content-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.content-icon {
  color: #0052cc;
  font-size: 16px;
}

.content-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.content-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.content-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.content-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.content-text {
  font-size: 13px;
  color: #1f2937;
  line-height: 1.5;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  font-size: 11px;
  border-radius: 4px;
}

.no-keywords {
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}

/* 媒体区域样式 */
.audio-section {
  padding: 0 24px 16px;

  @media (max-width: 768px) {
    padding: 0 20px 12px;
  }
}

.audio-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.audio-icon {
  color: #0052cc;
  font-size: 16px;
}

.audio-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.audio-player {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
}

/* 对话区域样式 */
.dialog-section {
  padding: 0 24px 24px;

  @media (max-width: 768px) {
    padding: 0 20px 20px;
  }
}

.dialog-row {
  @media (max-width: 768px) {
    margin: 0 !important;
  }
}

.dialog-col,
.ai-col {
  @media (max-width: 768px) {
    padding: 0 !important;
    margin-bottom: 16px;
  }
}

.dialog-container,
.ai-container {
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dialog-header,
.ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  background: white;
  border-radius: 8px 8px 0 0;
}

.dialog-icon,
.ai-icon {
  color: #0052cc;
  font-size: 16px;
}

.dialog-title,
.ai-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.dialog-scrollbar {
  flex: 1;
  padding: 16px;

  :deep(.el-scrollbar__wrap) {
    overflow-x: hidden;
  }

  :deep(.el-scrollbar__bar) {
    &.is-vertical {
      right: 4px;
      width: 6px;

      .el-scrollbar__thumb {
        background: rgba(0, 82, 204, 0.3);
        border-radius: 3px;
      }
    }
  }
}

.dialog-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-item {
  display: flex;
  flex-direction: column;
  gap: 6px;

  &.message-left {
    align-items: flex-start;
  }

  &.message-right {
    align-items: flex-end;
  }
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;

  &.avatar-system {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  }

  &.avatar-user {
    background: linear-gradient(135deg, #0052cc 0%, #1d4ed8 100%);
  }
}

.message-time {
  font-size: 11px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;

  &:hover {
    color: #0052cc;
  }
}

.message-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;

  &.bubble-system {
    background: linear-gradient(135deg, #e6fffa 0%, #d1fae5 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
  }

  &.bubble-user {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
  }
}

.no-dialog,
.no-ai {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #9ca3af;
}

.no-dialog-icon,
.no-ai-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.no-dialog-text,
.no-ai-text {
  font-size: 14px;
  font-weight: 500;
}

.ai-content {
  flex: 1;
  padding: 16px;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .detail-container {
    background: #1f2937;
  }

  .detail-header,
  .info-section,
  .analysis-section,
  .media-section {
    background: #374151;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .detail-title {
    color: #f9fafb;
  }

  .detail-subtitle {
    color: #d1d5db;
  }

  .section-title {
    color: #f9fafb;
  }

  .item-value {
    color: #f9fafb;
  }

  .analysis-card {
    background: #4b5563;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .card-title {
    color: #f9fafb;
  }

  .metric-value {
    color: #f9fafb;
  }

  .content-text {
    background: #4b5563;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f9fafb;
  }

  .dialog-container,
  .ai-container {
    background: #4b5563;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .dialog-header,
  .ai-header {
    background: #374151;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .dialog-title,
  .ai-title {
    color: #f9fafb;
  }

  .audio-player {
    background: #4b5563;
    border-color: rgba(255, 255, 255, 0.1);
  }
}
</style>
